#ifndef USER_H
#define USER_H

#include "botan/secmem.h"
#include <botan/symkey.h>
#include <botan/mem_ops.h>
#include <filesystem>
#include <string>

#include <utils/enums.h>

namespace users {
class user
{
public:
	std::string _login;
	std::string _salt;
	utils::CipherAlgorithm _cipher_algorithm_{utils::CipherAlgorithm::Kuznyechik_CBC};
	std::filesystem::path _dataPath;
	std::filesystem::path _totpPath;

	user();

	user(const std::string& line);

	void setHashedPassword(const std::string& hashedPassword);

	void setHashedPassword(const Botan::secure_vector<uint8_t>& hashedPassword);

	bool compare_hashes(const Botan::secure_vector<uint8_t>& hash1) const;

	Botan::SymmetricKey generatePass() const;


private:
	std::string getHash() const;

	Botan::secure_vector<std::uint8_t>  _hashedPassword;


	friend std::string to_string(const user& user);
};

std::string to_string(const users::user& user);
}
#endif // USER_H
